package com.ithinkstudio.jeez.generator;

import java.util.List;

import javax.annotation.PostConstruct;

import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component;

import com.ithinkstudio.jeez.generator.config.po.TableInfo;
import com.ithinkstudio.jeez.generator.db.DbQueryFactory;
import com.ithinkstudio.jeez.generator.db.IDbQuery;

/**
 * 生成服务
 * @author felix
 */
@Component
@DependsOn(value = {"springUtils"})
public class GenerateService {

    private IDbQuery dbQuery;

    /**
     * 实例化后调用init初始化查询器
     */
    @PostConstruct
    private void init() {
        dbQuery = DbQueryFactory.getDbQuery();
    }

    public void generate() {
        List<TableInfo> tableInfoList = dbQuery.getGenerateTableList();
        for(TableInfo tableInfo : tableInfoList) {
            System.out.println(tableInfo);
        }
    }


}
